package com.example.lib_base.http

import com.blankj.utilcode.util.SPUtils
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

class TokenRetrofitImpl : HttpRetrofitImpl {
    override fun createRetrofit(): Retrofit {
        return Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create())//

            .baseUrl(Cont.BASE_URL)
            .client(createHttpCilent().addInterceptor {
                it.proceed(
                    it.request().newBuilder()
                        .addHeader("accessId", Cont.ACCESS_ID)
                        .addHeader(Cont.TOKEN, SPUtils.getInstance().getString(Cont.TOKEN)).build()
                )
            }.build())
            .build()
    }
}